package com.dubbo.hyp.thread;

import com.dubbo.hyp.bean.ConsumerComponent;

public class ConsumerThread implements Runnable {

    private String method;
    private ConsumerComponent service;

    public ConsumerThread(String methodName, ConsumerComponent helloService) {
        method = methodName;
        service = helloService;
    }


    @Override
    public void run() {
        while (true){
            switch (method) {
                case "A":
                    service.getTimeA();
                    break;
                case "B":
                    service.getTimeB();
                    break;
                case "C":
                    service.getTimeC();
                    break;
            }
        }

    }
}
